package com.lianjinsoft.receiver;

import com.lianjinsoft.util.LogUtil;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * 部门：软件开发事业部
 * 功能：
 * 描述：
 * 作成者：李磊
 * 作成时间：2019/8/8
 **/
@Component
public class DeadDelayReceive {
    @RabbitHandler
    @RabbitListener(queues = "DELAY_PROCESS_QUEUE_NAME")
    public void receive(String msg){
        LogUtil.info("DELAY_PROCESS_QUEUE_NAME:"+msg);
    }
    @RabbitHandler
    @RabbitListener(queues = "DELAY_QUEUE_PER_MESSAGE_TTL_NAME")
    public void receive1(String msg){
        if("FAIL_MESSAGE".equals(msg)){
            System.err.println("111111111111111111111111111111");
            throw new RuntimeException();
        }
        LogUtil.info("DELAY_QUEUE_PER_QUEUE_TTL_NAME:"+msg);
    }
}
